home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Magazine / PC2Amiga / Samba / docs / textdocs / DIAGNOSIS.txt < prev    next >
Text File  |  2000-04-25  |  13KB  |  329 lines

  1. !==
  2. !== DIAGNOSIS.txt for Samba release 2.0.7 26 Apr 2000
  3. !==
  4. Contributor:    Andrew Tridgell
  5. Updated:    November 1, 1999
  6.  
  7. Subject:    DIAGNOSING YOUR SAMBA SERVER
  8. ===========================================================================
  9.  
  10. This file contains a list of tests you can perform to validate your
  11. Samba server. It also tells you what the likely cause of the problem
  12. is if it fails any one of these steps. If it passes all these tests
  13. then it is probably working fine.
  14.  
  15. You should do ALL the tests, in the order shown. I have tried to
  16. carefully choose them so later tests only use capabilities verified in
  17. the earlier tests.
  18.  
  19. If you send me an email saying "it doesn't work" and you have not
  20. followed this test procedure then you should not be surprised if I
  21. ignore your email.
  22.  
  23.  
  24. ASSUMPTIONS
  25. -----------
  26.  
  27. In all of the tests I assume you have a Samba server called BIGSERVER
  28. and a PC called ACLIENT both in workgroup TESTGROUP. I also assume the
  29. PC is running windows for workgroups with a recent copy of the
  30. microsoft tcp/ip stack. Alternatively, your PC may be running Windows
  31. 95 or Windows NT (Workstation or Server).
  32.  
  33. The procedure is similar for other types of clients.
  34.  
  35. I also assume you know the name of an available share in your
  36. smb.conf. I will assume this share is called "tmp". You can add a
  37. "tmp" share like by adding the following to smb.conf:
  38.  
  39. [tmp]
  40.  comment = temporary files 
  41.  path = /tmp
  42.  read only = yes
  43.  
  44.  
  45. THESE TESTS ASSUME VERSION 2.0.6 OR LATER OF THE SAMBA SUITE. SOME
  46. COMMANDS SHOWN DID NOT EXIST IN EARLIER VERSIONS
  47.  
  48. Please pay attention to the error messages you receive. If any error message
  49. reports that your server is being unfriendly you should first check that you
  50. IP name resolution is correctly set up. eg: Make sure your /etc/resolv.conf
  51. file points to name servers that really do exist.
  52.  
  53. Also, if you do not have DNS server access for name resolution please check
  54. that the settings for your smb.conf file results in "dns proxy = no". The
  55. best way to check this is with "testparm smb.conf"
  56.  
  57.  
  58. TEST 1:
  59. -------
  60.  
  61. In the directory in which you store your smb.conf file, run the command
  62. "testparm smb.conf". If it reports any errors then your smb.conf
  63. configuration file is faulty.
  64.  
  65. Note:    Your smb.conf file may be located in: /etc
  66.     Or in:   /usr/local/samba/lib
  67.  
  68.  
  69. TEST 2:
  70. -------
  71.  
  72. run the command "ping BIGSERVER" from the PC and "ping ACLIENT" from
  73. the unix box. If you don't get a valid response then your TCP/IP
  74. software is not correctly installed. 
  75.  
  76. Note that you will need to start a "dos prompt" window on the PC to
  77. run ping.
  78.  
  79. If you get a message saying "host not found" or similar then your DNS
  80. software or /etc/hosts file is not correctly setup. It is possible to
  81. run samba without DNS entries for the server and client, but I assume
  82. you do have correct entries for the remainder of these tests. 
  83.  
  84. Another reason why ping might fail is if your host is running firewall 
  85. software. You will need to relax the rules to let in the workstation
  86. in question, perhaps by allowing access from another subnet (on Linux
  87. this is done via the ipfwadm program.)
  88.  
  89.  
  90. TEST 3:
  91. -------
  92.  
  93. Run the command "smbclient -L BIGSERVER" on the unix box. You
  94. should get a list of available shares back. 
  95.  
  96. If you get a error message containing the string "Bad password" then
  97. you probably have either an incorrect "hosts allow", "hosts deny" or
  98. "valid users" line in your smb.conf, or your guest account is not
  99. valid. Check what your guest account is using "testparm" and
  100. temporarily remove any "hosts allow", "hosts deny", "valid users" or
  101. "invalid users" lines.
  102.  
  103. If you get a "connection refused" response then the smbd server may
  104. not be running. If you installed it in inetd.conf then you probably edited
  105. that file incorrectly. If you installed it as a daemon then check that
  106. it is running, and check that the netbios-ssn port is in a LISTEN
  107. state using "netstat -a".
  108.  
  109. If you get a "session request failed" then the server refused the
  110. connection. If it says "Your server software is being unfriendly" then
  111. its probably because you have invalid command line parameters to smbd,
  112. or a similar fatal problem with the initial startup of smbd. Also
  113. check your config file (smb.conf) for syntax errors with "testparm"
  114. and that the various directories where samba keeps its log and lock
  115. files exist.
  116.  
  117. There are a number of reasons for which smbd may refuse or decline
  118. a session request. The most common of these involve one or more of
  119. the following smb.conf file entries:
  120.     hosts deny = ALL
  121.     hosts allow = xxx.xxx.xxx.xxx/yy
  122.     bind interfaces only = Yes
  123.  
  124. In the above, no allowance has been made for any session requests that
  125. will automatically translate to the loopback adaptor address 127.0.0.1.
  126. To solve this problem change these lines to:
  127.     hosts deny = ALL
  128.     hosts allow = xxx.xxx.xxx.xxx/yy 127.
  129. Do NOT use the "bind interfaces only" parameter where you may wish to
  130. use the samba password change facility, or where smbclient may need to
  131. access local service for name resolution or for local resource
  132. connections. (Note: the "bind interfaces only" parameter deficiency
  133. where it will not allow connections to the loopback address will be
  134. fixed soon).
  135.  
  136. Another common cause of these two errors is having something already running 
  137. on port 139, such as Samba (ie: smbd is running from inetd already) or
  138. something like Digital's Pathworks. Check your inetd.conf file before trying
  139. to start smbd as a daemon, it can avoid a lot of frustration!
  140.  
  141. And yet another possible cause for failure of TEST 3 is when the subnet mask
  142. and / or broadcast address settings are incorrect. Please check that the
  143. network interface IP Address / Broadcast Address / Subnet Mask settings are
  144. correct and that Samba has correctly noted these in the log.nmb file.
  145.  
  146. TEST 4:
  147. -------
  148.  
  149. Run the command "nmblookup -B BIGSERVER __SAMBA__". You should get the
  150. IP address of your Samba server back.
  151.  
  152. If you don't then nmbd is incorrectly installed. Check your inetd.conf
  153. if you run it from there, or that the daemon is running and listening
  154. to udp port 137.
  155.  
  156. One common problem is that many inetd implementations can't take many
  157. parameters on the command line. If this is the case then create a
  158. one-line script that contains the right parameters and run that from
  159. inetd.
  160.  
  161.  
  162. TEST 5:
  163. -------
  164.  
  165. run the command "nmblookup -B ACLIENT '*'"
  166.  
  167. You should get the PCs IP address back. If you don't then the client
  168. software on the PC isn't installed correctly, or isn't started, or you
  169. got the name of the PC wrong. 
  170.  
  171. If ACLIENT doesn't resolve via DNS then use the IP address of the
  172. client in the above test.
  173.  
  174.  
  175. TEST 6:
  176. -------
  177.  
  178. Run the command "nmblookup -d 2 '*'"
  179.  
  180. This time we are trying the same as the previous test but are trying
  181. it via a broadcast to the default broadcast address. A number of
  182. Netbios/TCPIP hosts on the network should respond, although Samba may
  183. not catch all of the responses in the short time it listens. You
  184. should see "got a positive name query response" messages from several
  185. hosts. 
  186.  
  187. If this doesn't give a similar result to the previous test then
  188. nmblookup isn't correctly getting your broadcast address through its
  189. automatic mechanism. In this case you should experiment use the
  190. "interfaces" option in smb.conf to manually configure your IP
  191. address, broadcast and netmask. 
  192.  
  193. If your PC and server aren't on the same subnet then you will need to
  194. use the -B option to set the broadcast address to the that of the PCs
  195. subnet.
  196.  
  197. This test will probably fail if your subnet mask and broadcast address are
  198. not correct. (Refer to TEST 3 notes above).
  199.  
  200. TEST 7:
  201. -------
  202.  
  203. Run the command "smbclient //BIGSERVER/TMP". You should then be
  204. prompted for a password. You should use the password of the account
  205. you are logged into the unix box with. If you want to test with
  206. another account then add the -U <accountname> option to the end of
  207. the command line.  eg: smbclient //bigserver/tmp -Ujohndoe
  208.  
  209. Note: It is possible to specify the password along with the username
  210. as follows:
  211.     smbclient //bigserver/tmp -Ujohndoe%secret
  212.  
  213. Once you enter the password you should get the "smb>" prompt. If you
  214. don't then look at the error message. If it says "invalid network
  215. name" then the service "tmp" is not correctly setup in your smb.conf.
  216.  
  217. If it says "bad password" then the likely causes are:
  218.  
  219. - you have shadow passords (or some other password system) but didn't
  220. compile in support for them in smbd
  221. - your "valid users" configuration is incorrect
  222. - you have a mixed case password and you haven't enabled the "password
  223. level" option at a high enough level
  224. - the "path =" line in smb.conf is incorrect. Check it with testparm
  225. - you enabled password encryption but didn't create the SMB encrypted
  226. password file
  227. - The uid for the user in smbpasswd is different from that in /etc/passwd.
  228.  
  229. If none of these causes appear to be the problem, check the
  230. samba logs in the log directory (typically /usr/local/samba/var) for more details.
  231.  
  232. Once connected you should be able to use the commands "dir" "get"
  233. "put" etc. Type "help <command>" for instructions. You should
  234. especially check that the amount of free disk space shown is correct
  235. when you type "dir".
  236.  
  237.  
  238. TEST 8:
  239. -------
  240.  
  241. On the PC type the command "net view \\BIGSERVER". You will need to do
  242. this from within a "dos prompt" window. You should get back a list of
  243. available shares on the server.
  244.  
  245. If you get a "network name not found" or similar error then netbios
  246. name resolution is not working. This is usually caused by a problem in
  247. nmbd. To overcome it you could do one of the following (you only need
  248. to choose one of them):
  249.  
  250. - fixup the nmbd installation
  251. - add the IP address of BIGSERVER to the "wins server" box in the
  252. advanced tcp/ip setup on the PC.
  253. - enable windows name resolution via DNS in the advanced section of
  254. the tcp/ip setup
  255. - add BIGSERVER to your lmhosts file on the PC.
  256.  
  257. If you get a "invalid network name" or "bad password error" then the
  258. same fixes apply as they did for the "smbclient -L" test above. In
  259. particular, make sure your "hosts allow" line is correct (see the man
  260. pages)
  261.  
  262. Also, do not overlook that fact that when the workstation requests the
  263. connection to the samba server it will attempt to connect using the 
  264. name with which you logged onto your Windows machine. You need to make
  265. sure that an account exists on your Samba server with that exact same
  266. name and password.
  267.  
  268. If you get "specified computer is not receiving requests" or similar
  269. it probably means that the host is not contactable via tcp services.
  270. Check to see if the host is running tcp wrappers, and if so add an entry in
  271. the hosts.allow file for your client (or subnet, etc.)
  272.  
  273.  
  274. TEST 9:
  275. --------
  276.  
  277. Run the command "net use x: \\BIGSERVER\TMP". You should be prompted
  278. for a password then you should get a "command completed successfully"
  279. message. If not then your PC software is incorrectly installed or your
  280. smb.conf is incorrect. make sure your "hosts allow" and other config
  281. lines in smb.conf are correct.
  282.  
  283. It's also possible that the server can't work out what user name to
  284. connect you as. To see if this is the problem add the line "user =
  285. USERNAME" to the [tmp] section of smb.conf where "USERNAME" is the
  286. username corresponding to the password you typed. If you find this
  287. fixes things you may need the username mapping option.
  288.  
  289. TEST 10:
  290. --------
  291.  
  292. Run the command "nmblookup -M TESTGROUP" where TESTGROUP is the name
  293. of the workgroup that your Samba server and Windows PCs belong to. You
  294. should get back the IP address of the master browser for that
  295. workgroup.
  296.  
  297. If you don't then the election process has failed. Wait a minute to
  298. see if it is just being slow then try again. If it still fails after
  299. that then look at the browsing options you have set in smb.conf. Make
  300. sure you have "preferred master = yes" to ensure that an election is
  301. held at startup.
  302.  
  303. TEST 11:
  304. --------
  305.  
  306. From file manager try to browse the server. Your samba server should
  307. appear in the browse list of your local workgroup (or the one you
  308. specified in smb.conf). You should be able to double click on the name
  309. of the server and get a list of shares. If you get a "invalid
  310. password" error when you do then you are probably running WinNT and it
  311. is refusing to browse a server that has no encrypted password
  312. capability and is in user level security mode. In this case either set
  313. "security = server" AND "password server = Windows_NT_Machine" in your
  314. smb.conf file, or enable encrypted passwords AFTER compiling in support
  315. for encrypted passwords (refer to the Makefile).
  316.  
  317.  
  318. Still having troubles?
  319. ----------------------
  320.  
  321. Try the mailing list or newsgroup, or use the tcpdump-smb utility to
  322. sniff the problem. The official samba mailing list can be reached at
  323. samba@samba.org. To find out more about samba and how to
  324. subscribe to the mailing list check out the samba web page at
  325.               http://samba.org/samba
  326.  
  327. Also look at the other docs in the Samba package!
  328.  
  329.